﻿using System.Collections.Generic;
using Comunication;
using ServerDomain.Properties;

namespace ServerDomain.CommandFolder
{
    class DownloadClientServerFindServerResponse : Command
    {
        public DownloadClientServerFindServerResponse(KeyValuePair<string, string>? file)
        {
            Header = "RES";
            Cmd = Commands.DOWNLOAD_SERVER_CLIENT_FIND_SERVER_RESPONSE;
            if (file!=null)
            {
                var fileMD5 = file.GetValueOrDefault().Key;
                var fileName = file.GetValueOrDefault().Value;
                Data = "MD5:" + fileMD5 + ";" + "FILENAME:" + fileName + ";TCPPORT:" + Settings.Default.TcpPort;
            }
            else
            {
                Data = string.Empty;
            }
        }
    }
}
